// Solar2.c: Creates a moving planet without WED at all.

//#include <acknex.h>
//#include <default.c>
//
// Global VARS
//BMAP* omegaViiLogo = "omega_vii.png";
//double fps;
//var selectedNum;
//var planetPan;
//
//ENTITY* selected;
//ENTITY* sun;
//ENTITY* planet;
//
//PANEL* logoPanel = {
//	bmap = omegaViiLogo;
//	layer = 0;
//	flags = VISIBLE;
//}

//PANEL* fpsPanel = {
//	digits(10, 400, "Frames: %3.0f", *, 1, total_frames);
//	digits(10, 410, "Secs: %3.0f", *, 1, total_secs);
//	digits(10, 420, "Selected: %3.0f", *, 1, selectedNum);
//	digits(10, 430, "Planet pan: %3.0f", *, 1, planetPan);
//
//	flags = VISIBLE;
//}

// Functions
//action planetAction();
//void positionLogoPanel();
//void selectClicked();

//void main() {
////	video_mode = 8;
////	mouse_mode = 4;
//
////	level_load(0);
////	wait(3);
//
//	positionLogoPanel();
//
//	sun = ent_create("sphere.mdl", vector(0, 0, 0), NULL);
//	//sun.emask = ENABLE_CLICK;
//	//sun.event = selectClicked;
//	planet = ent_create("earth.mdl", vector(100, 0, 0), planetAction);
//	//planet.emask = ENABLE_CLICK;
//	//planet.event = selectClicked;
//
//	on_click = selectClicked;
//
//	// GAME LOOP
//	while (true) {
//
//		// Empty for the moment, all is done with events.
//
//		wait(1);
//	}
//		
//}

action planetAction() {
	while(1) {
		my.x = 500 * cos(0.5 * 2 * 3.1415 * total_ticks / 16.0)+3576;
		my.y = 400 * sin(0.5 * 2 * 3.1415 * total_ticks / 16.0)+3576;

//		if (selected == me) {
//			my.pan = cycle(my.pan + 1 * 360 * time_step / 16, 0, 360); // 5secs per turn
//			planetPan = my.pan; // i kind of dislike lite-c...
//		}
		
		wait(1);
	}
}

//void positionLogoPanel() {
//	logoPanel.pos_x = 0.5 * (screen_size.x - bmap_width(omegaViiLogo));
//	logoPanel.pos_y = 1.0 * (screen_size.y - bmap_height(omegaViiLogo));	
//}
//
//void selectClicked() {
//	selected = mouse_ent;
//	switch(selected) {
//		case sun:
//			selectedNum = 1;
//			break;
//		case planet:
//			selectedNum = 2;
//			break;
//		default:
//			selectedNum = 3;
//			break;
//	}	
//}